package tech.aister.day02;

public class Test1 {
    public static void main(String[] args) {
        String checksum = "690123456789x";
        char[] str = checksum.toCharArray();
        //System.out.println(str[1]);
        int len = checksum.length();
        int num = -48;
        int sum = -48;
        int x = 0;
        for (int i = 0; i < len-1; i++) {
            if(i%2==0||i==0){
                sum+=str[i];
            }
            else{
                num+=str[i];
            }
        }
        num = num*3+sum;
        x = 10-num%10;
        System.out.println(x);
    }
}
